from case.po.base_case2 import BaseCase
from page.base_page2 import BasePage
from selenium.webdriver.common.by import By

"""发送邮件页面"""
class SendEmailPage(BasePage):
    url = '/crm5/index.php?m=setting&a=sendemail&model=customer&customer_ids=all'

    def switch_to_current_window(self):
        """切换到当前窗口（最后一个打开的窗口）"""
        # 获取所有窗口句柄
        all_handles = self.driver.window_handles
        # 切换到最后一个窗口（通常是最新打开的）
        self.driver.switch_to.window(all_handles[-1])
        return self.driver.current_url

    def get_current_url(self):
        """获取当前页面的url"""
        return self.driver.current_url


